package ch5.ext;

public class AnimalDoctor {
	private String name, tele;

	public AnimalDoctor(String name, String tele) {
		super();
		this.name = name;
		this.tele = tele;
	}

	// 给狗看病
	public void cure(Pet d) {
		// 如果来看病的宠物是老虎，把嘴捆起来
		if (d instanceof Tiger) {
			System.out.println("是老虎，把" + d.getName() + "的嘴捆起来");
		}
		System.out.println(name + "让宠物叫一下，跑动一下：");
		d.run();
		d.shout();
		if (d.getHealth() < 60) {
			System.out.println(name + "给狗" + d.getName() + "量体温，看诊");
			System.out.println("开药");
			d.setHealth(80);
			System.out.println(d.getName() + "恢复了健康");
		} else {
			System.out.println(d.getName() + "很健康，没病");
		}
	}
	// public void cure(Dog d) {
	// if (d.getHealth() < 60) {
	// System.out.println(name + "给狗" + d.getName() + "量体温，看诊");
	// System.out.println("开药");
	// d.setHealth(80);
	// System.out.println(d.getName() + "恢复了健康");
	// } else {
	// System.out.println(d.getName() + "很健康，没病");
	// }
	// }
	//
	// public void cure(GoldFish d) {
	// if (d.getHealth() < 60) {
	// System.out.println(name + "给金鱼" + d.getName() + "量体温，看诊");
	// System.out.println("开药");
	// d.setHealth(80);
	// System.out.println(d.getName() + "恢复了健康");
	// } else {
	// System.out.println(d.getName() + "很健康，没病");
	// }
	// }
	//
	// public void cure(Cat d) {
	// if (d.getHealth() < 60) {
	// System.out.println(name + "给猫" + d.getName() + "量体温，看诊");
	// System.out.println("开药");
	// d.setHealth(80);
	// System.out.println(d.getName() + "恢复了健康");
	// } else {
	// System.out.println(d.getName() + "很健康，没病");
	// }
	// }
}
